It is previously known that the rare earth metals samarium (Sm), terbium (Tb), dysprosium (Dy), holmium (Ho), erbium (Er), etc., have a very high magnetostriction at very low temperatures. By alloying the rare earth metals with iron (Fe), a very high magnetostriction can be obtained also at room temperature and at temperatures of up to two to three hundred degrees Celsius. With a rod of an alloy of the type mentioned above, magnetic energy can be transformed into mechanical energy, the mechanical energy substantially manifesting itself in the form of a deformation of the rod. With alloys with iron and the rare earth metals at room temperatures, it is possible to obtain a magnetostriction of 1500-2000 .mu.m/m, which is a linear expansion more than 30 times greater than for ordinary magnetostrictive alloys. Since a rod of the above-mentioned alloy, for example terfenol (Terfenol-D, Tb.sub.x Dy.sub.1-xc Fe.sub.1.9-1.98) has a considerably lower tensile strength than compressive strength, the rod has to work under a compressive mechanical prestress. The necessary mechanical prestress to prevent the occurrence of a tensile stress in a rod of terfenol, at transient magnetization and a large mechanical load, is considerably greater than the prestress which is justified by merely taking into account the choice of an optimum working point.